package edu.jd.movieplatform.c_admin.hall.impl;

import edu.jd.movieplatform.c_admin.hall.c_HallDto;
import edu.jd.movieplatform.c_admin.hall.c_HallService;
import edu.jd.movieplatform.c_admin.hall.dao.c_HallDao;
import edu.jd.movieplatform.common.Utils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.Map;

@Service
@Transactional
public class C_HallServiceImpl implements c_HallService {

    @Resource
    private c_HallDao cHallDao;

    @Override
    public Map<String, Object> getHallList(c_HallDto dto) {
        return Utils.getPage(dto, () -> cHallDao.findHallList(dto));
    }

    @Override
    public void addHall(c_HallDto dto) {
        cHallDao.insertHall(dto);
    }

    @Override
    public void updHall(c_HallDto dto) {
        cHallDao.updateHall(dto);
    }

    @Override
    public void delHall(c_HallDto dto) {
        cHallDao.deleteHall(dto);
    }
}
